<?php

namespace app\index\controller;
use app\index\model\Login;
use think\Db;
use think\Session;

class Logins
{
    public function index()
    {
       $login=new Login();
       try{
           $user=$login->login();
           $accessUrls=$login->getAccessUrls($user['role_id']);
           $menuData=$login->getMenuData($user['role_id']);
           Session::set('user',$user);
           Session::set('accessUrls',$accessUrls);
           /*print_r($accessUrls);
           die;*/
          // return['status'=>true,'user'=>$user];
           return['status'=>true,'menuData'=>$menuData];
       }catch (\Exception $e){
         return['status'=>false,'error'=>$e->getMessage()];
       }
    }
}
